package StringDemo.Replace;

public class Example {
    public static void main(String[] args) {
        String swearing = "cnm,nmsl,sb";
        System.out.println(replace(swearing));
    }

    public static String replace(String phrase) {
        String[] swearings = {"nmsl", "nmb", "cnm", "sb", "wcnm", "nt"};
        for (String i : swearings) {
            phrase = phrase.replace(i,"****");
        }
        return phrase;
    }
}
